package com.hqyj.hrms.modules.account.controller;

import com.hqyj.hrms.modules.account.entity.Role;
import com.hqyj.hrms.modules.account.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    RoleService roleService;

    //新增
    @GetMapping("/add")
    public HashMap<String, Object> add(Role role) {
        return roleService.add(role);
    }

    //修改
    @GetMapping("/update")
    public HashMap<String, Object> update(Role role) {
        return roleService.update(role);
    }

    //删除
    @GetMapping("/del")
    public HashMap<String, Object> del(Integer id) {
        return roleService.del(id);
    }

    //查询
    @GetMapping("/list")
    public HashMap<String, Object> list(Role role) {
        return roleService.list(role);
    }
}
